#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStackedWidget>
#include "selectemployeeinfoview.h"
#include "checkview.h"
#include "edepartmentchangeview.h"
#include "salarydetailview.h"
#include "assessmentdetailview.h"
#include "leaveapplicationview.h"
#include "employeemanager.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onEmployeeInfoQuery();
    void onCheckInOut();
    void onDepartmentChangeApply();
    void onSalaryDetail();
    void onAssessmentDetail();
    void onLeaveApplication();
    void onLogout();

private:
    void setupUI();
    void setupMenus();
    void setupToolbars();
    void setupConnections();

    Ui::MainWindow *ui;
    QStackedWidget *m_stackedWidget;

    // 视图组件
    SelectEmployeeInfoView *m_employeeInfoView;
    CheckView *m_checkInOutView;
    EDepartmentChangeView *m_departmentChangeView;
    SalaryDetailView *m_salaryDetailView;
    AssessmentDetailView *m_assessmentDetailView;
    LeaveApplicationView *m_leaveApplicationView;

    // 数据成员
    EmployeeManager *m_employeeManager;
    QString m_employeeId; // 存储当前登录员工ID

public:
    void setEmployeeId(const QString &employeeId); // 设置员工ID
};
#endif // MAINWINDOW_H
